package com.mystnihon.freeremote.loader.torrent;

import android.util.Log;
import ca.benow.transmission.TransmissionClient;

import com.mystnihon.freeremote.config.Config;
import com.octo.android.robospice.request.SpiceRequest;

public class RemoveTorrentRequest extends SpiceRequest<Void> {

	private static final String TAG = RemoveTorrentRequest.class.getSimpleName();
	private TransmissionClient mclient;
	Object[] mIds;
	boolean mDeleteLocalData;

	public RemoveTorrentRequest(TransmissionClient client, boolean deleteLocalData, Object... ids) {
	    super(Void.class);
		mclient = client;
		mDeleteLocalData = deleteLocalData;
		mIds = ids;
	}


    @Override
    public Void loadDataFromNetwork() throws Exception {
        if (Config.DEBUG_MODE_ENABLED)
            Log.d(TAG, "Deleting");
        mclient.removeTorrents(mIds, mDeleteLocalData);
        return null;
    }

}
